package com.repair.servlet.mokuaiconf;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.repair.dao.Module.impl.ModuleDao;
import com.repair.domain.Module;

public class MkcfServlet extends HttpServlet{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5491765438602770592L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doPost(req, resp);
		
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		String mid = req.getParameter("moduleid");
		System.out.println("mid:"+mid);

		int moduleid=0;
		moduleid = Integer.parseInt(mid);
		
		String modulename = req.getParameter("modulename");
		String moduleview = req.getParameter("moduleview");
		ModuleDao service = new ModuleDao();
		Module obj = new Module();
		obj.setModuleid(moduleid);
		obj.setModulename(modulename);
		obj.setModuleview(moduleview);
		service.saveModule(obj);
		
	}

}
